<?php require('includes/header.php'); ?>
<?php require('includes/nav.php'); ?>
	
	<!-- creating div for login form to float to the right side of screen -->
	<div style="float:right; border-left:1px solid #000000; font-size:12pt; padding-left:25px; margin:0px; clear:left;">
		
		<?php if(isset($log)): ?>
			<div class="errors">
				<?php echo $log; ?>
			</div>
		<?php endif; ?>
		
		<!-- creating form for user to login -->
		<form action="/runningrecords/index.php/main/login" method="post">
			<table class="form">
				<tr>
					<th colspan="2" style="font-size:20pt;">Sign In</th>
				</tr>
							
				<tr>
					<td><input type="text" name="username" value="Username" onfocus="value=''" maxlength="35" /></td>
					<td><input type="text" name="password" value="Password" onfocus="value='', type='password'" maxlength="35" /></td>
				</tr>
				
				<tr>
					<td colspan="2" align="center">
						<input type="submit" value="Log In" />
						<p>
							<a href="index.php/main/recover">Forgot your password?</a>
						</p>
					</td>
				</tr>
			</table>
		</form>
	</div>
	
	<!-- creating div for the register form to float to the left side of screen -->
	<div style="clear:left;">
		
		<!-- creating form for user to be able to register -->
		<form action="/runningrecords/index.php/main/register" method="post">	
			
			<?php if(isset($errors)): ?>
				<div class="errors">
					<?php foreach($errors as $e_key => $e_vals): ?>
						<?php echo $e_vals; ?> <br />
					<?php endforeach; ?>
				</div>
			<?php endif; ?>
		  
			<table class="form">
				<tr>
					<th colspan="2" style="font-size:14pt;">Register</th>
				</tr>
				
				<tr>
				  <td align="right">Username</td>
				  <td><input type="text" size="35" maxlength="25" name="username" value="<?php if(isset($_POST['username'])) echo $_POST['username']; ?>" /></td>
				</tr>
				
				<tr>
			  		<td align="right"> Password</td>
				  <td><input type="password" size="35" maxlength="35" name="password" value="<?php if(isset($_POST['password'])) echo $_POST['password']; ?>" /></td>
				</tr>
								
				<tr>
				  <td align="right">Email</td>
				  <td><input name="email" type="text" size="35" maxlength="100" value="<?php if(isset($_POST['email'])) echo $_POST['email']; ?>" /></td>
				</tr>
				
				<tr>
					<td colspan="2">
						Choose a security question for the recovery of your password.
					</td>
				</tr>
				<tr>
					<td align="right">
						Question:
					</td>
					<td>
						<select name="pw_rec_question">
							<option value="1">My Mother's maiden name</option>
							<option value="2">My first pet's name</option>
							<option value="3">My first car</option>
							<option value="4">My favorite out-door activity</option>
							<option value="5">My favorite movie</option>
						</select>
					</td>
				</tr>
				
				<tr>
					<td align="right">
						Answer:
					</td>
					<td>
						<input type="text" name="pw_rec_answer" />
					</td>
				</tr>
				
				<tr>
				  <td colspan="2" align="center"><input type="submit" value=" Register to Run >>" /></td>
				</tr>
			  </table>
		</form>
		
	</div>
	
<?php require('includes/footer.php'); ?>